package samoloty.data;

import java.util.ArrayList;
import samoloty.model.IDataModel;
import samoloty.model.models.AcRegModel;
import samoloty.model.models.ConfigurationModel;
import samoloty.model.models.ConstModel;
import samoloty.model.models.CrewModel;
import samoloty.model.models.FuelModel;
import samoloty.model.models.HoldsModel;
import samoloty.model.models.IdealTrimModel;
import samoloty.model.models.LimitLawModel;
import samoloty.model.models.LimitTowModel;
import samoloty.model.models.LimitTowffModel;
import samoloty.model.models.LimitZfwModel;
import samoloty.model.models.LimitZfwffModel;
import samoloty.model.models.MaxWeightsModel;
import samoloty.model.models.PantryModel;
import samoloty.model.models.PaxModel;
import samoloty.model.models.StabTrimModel;
import samoloty.model.models.StabTrimSubModel;
import samoloty.model.models.StabTrimSubSubModel;

public class DataBase4 extends CommonDataBase implements IDataModel {

    public DataBase4() {
        super();
        initData();
    }

    public ArrayList<String> getAcReg() {
        return acRegData;
    }

    public ArrayList<ConfigurationModel> getConfiguration() {
        return configuration;
    }

    public ConstModel getConst() {
        return constData;
    }

    public ArrayList<CrewModel> getCrew() {
        return crewData;
    }

    public ArrayList<FuelModel> getFuel() {
        return fuelData;
    }

    public ArrayList<HoldsModel> getHolds() {
        return holdsData;
    }

    public ArrayList<LimitLawModel> getLimitLaw() {
        return limitLawData;
    }

    public ArrayList<LimitTowModel> getLimitTow() {
        return limitTowData;
    }

    public ArrayList<LimitTowffModel> getLimitTowff() {
        return limitTowffData;
    }

    public ArrayList<LimitZfwModel> getLimitZfw() {
        return limitZfwData;
    }

    public ArrayList<LimitZfwffModel> getLimitZfwff() {
        return limitZfwffData;
    }

    public MaxWeightsModel getMaxWeights() {
        return maxWeightsData;
    }

    public PantryModel getPantry() {
        return pantryData;
    }

    public ArrayList<PaxModel> getPax() {
        return paxData;
    }

    public StabTrimModel getStabTrimFlap1() {
        return stabTrimFlap1Data;
    }

    public StabTrimModel getStabTrimFlap2() {
        return stabTrimFlap2Data;
    }

    public StabTrimModel getStabTrimFlap3() {
        return stabTrimFlap3Data;
    }

    public StabTrimModel getStabTrimFlap4() {
        return stabTrimFlap4Data;
    }

    public ArrayList<IdealTrimModel> getIdealTrim() {
        return idealTrimData;
    }

    private void initData() {
        initAcReg();
        initConst();
        initCrew();
        initConfiguratin();
        initFuel();
        initHolds();
        initLimitLaw();
        initLimitTow();
        initLimitTowff();
        initLimitZfw();
        initLimitZfwff();
        initPantry();
        initPax();
        initMaxWeights();
        initStabTrimFlap1();
        initStabTrimFlap2();
        initStabTrimFlap3();
        initIdealTrim();
    }

    private void initAcReg() {
        acRegData = new ArrayList<String>();
        acRegData.add(new String("SP-LIA"));
        acRegData.add(new String("SP-LIB"));
        acRegData.add(new String("SP-LIC"));
        acRegData.add(new String("SP-LID"));
        acRegData.add(new String("SP-LIE"));
        acRegData.add(new String("SP-LIF"));
        acRegData.add(new String("SP-LIG"));
        acRegData.add(new String("SP-LIH"));
        acRegData.add(new String("SP-LII"));
        acRegData.add(new String("SP-LIK"));
        acRegData.add(new String("SP-LIL"));
        acRegData.add(new String("SP-LIM"));
        acRegData.add(new String("SP-LIN"));

    }

    private void initConst() {
        constData = new ConstModel(400, 70, 14.6, 13.763, 3.194);
    }

    private void initCrew() {
        crewData = new ArrayList<CrewModel>();
        crewData.add(new CrewModel("2/0", 2, 0, 170, -5.010));
        crewData.add(new CrewModel("2/2", 2, 2, 320, -5.220));
        crewData.add(new CrewModel("2/3", 2, 3, 395, -3.630));
        crewData.add(new CrewModel("3/0", 3, 0, 255, -7.370));
        crewData.add(new CrewModel("3/2", 3, 2, 405, -7.580));
        crewData.add(new CrewModel("3/3", 3, 3, 480, -5.990));

    }

    private void initConfiguratin() {
        configuration = new ArrayList<ConfigurationModel>();
        configuration.add(new ConfigurationModel("Y82", 0, 82, 0, 30, 0, 20, 0, 32));
        configuration.add(new ConfigurationModel("C6Y76", 6, 64, 6, 24, 0, 20, 0, 32));
        configuration.add(new ConfigurationModel("C10Y72", 10, 72, 10, 20, 0, 20, 0, 32));
        configuration.add(new ConfigurationModel("C14Y68", 14, 68, 14, 16, 0, 20, 0, 32));
        configuration.add(new ConfigurationModel("C18Y64", 18, 64, 18, 12, 0, 20, 0, 32));
        configuration.add(new ConfigurationModel("C22Y60", 22, 60, 22, 8, 0, 20, 0, 32));
        configuration.add(new ConfigurationModel("C26Y56", 26, 56, 26, 4, 2, 20, 0, 32));
        configuration.add(new ConfigurationModel("C30Y52", 30, 52, 30, 0, 0, 20, 0, 32));
        configuration.add(new ConfigurationModel("C34Y48", 34, 48, 30, 0, 4, 16, 0, 32));
        configuration.add(new ConfigurationModel("C38Y44", 38, 44, 30, 0, 8, 12, 0, 32));
        configuration.add(new ConfigurationModel("C42Y40", 42, 40, 30, 0, 12, 8, 0, 32));
        configuration.add(new ConfigurationModel("C46Y36", 46, 36, 30, 0, 16, 4, 0, 32));
        configuration.add(new ConfigurationModel("C50Y32", 50, 32, 30, 0, 20, 0, 0, 32));
        configuration.add(new ConfigurationModel("C54Y28", 54, 28, 30, 0, 20, 0, 4, 28));
        configuration.add(new ConfigurationModel("C58Y24", 58, 24, 30, 0, 20, 0, 8, 24));
        configuration.add(new ConfigurationModel("C62Y20", 62, 20, 30, 0, 20, 0, 12, 20));
        configuration.add(new ConfigurationModel("C66Y16", 66, 16, 30, 0, 20, 0, 16, 16));
        configuration.add(new ConfigurationModel("C70Y12", 70, 12, 30, 0, 20, 0, 20, 12));
        configuration.add(new ConfigurationModel("C74Y8", 74, 8, 30, 0, 20, 0, 24, 8));
        configuration.add(new ConfigurationModel("C78Y4", 78, 4, 30, 0, 20, 0, 28, 4));
        configuration.add(new ConfigurationModel("C82", 82, 0, 30, 0, 20, 0, 32, 0));

    }

    private void initFuel() {
        fuelData = new ArrayList<FuelModel>();
        fuelData.add(new FuelModel(0, 0.0));
        fuelData.add(new FuelModel(500, -1.1));
        fuelData.add(new FuelModel(1000, -2.3));
        fuelData.add(new FuelModel(1500, -3.5));
        fuelData.add(new FuelModel(2000, -4.7));
        fuelData.add(new FuelModel(2500, -5.8));
        fuelData.add(new FuelModel(3000, -6.8));
        fuelData.add(new FuelModel(3500, -7.8));
        fuelData.add(new FuelModel(4000, -8.8));
        fuelData.add(new FuelModel(4500, -9.7));
        fuelData.add(new FuelModel(5000, -10.6));
        fuelData.add(new FuelModel(5500, -11.4));
        fuelData.add(new FuelModel(6000, -12.2));
        fuelData.add(new FuelModel(6500, -12.9));
        fuelData.add(new FuelModel(7000, -13.4));
        fuelData.add(new FuelModel(7500, -13.4));
        fuelData.add(new FuelModel(8000, -12.9));
        fuelData.add(new FuelModel(8270, -12.5));
        fuelData.add(new FuelModel(8500, -12.1));
        fuelData.add(new FuelModel(8760, -11.4));
        fuelData.add(new FuelModel(9000, -10.6));
        fuelData.add(new FuelModel(9250, -9.7));
        fuelData.add(new FuelModel(9470, -8.7));

    }

    private void initHolds() {
        holdsData = new ArrayList<HoldsModel>();
        holdsData.add(new HoldsModel("1", 633, -0.02116));
        holdsData.add(new HoldsModel("2", 867, -0.01336));
        holdsData.add(new HoldsModel("3", 828, 0.01269));
        holdsData.add(new HoldsModel("4", 322, 0.01943));

    }

    private void initLimitZfw() {
        limitZfwData = new ArrayList<LimitZfwModel>();
        limitZfwData.add(new LimitZfwModel(22500, 45.3, 22500, 63.9));
        limitZfwData.add(new LimitZfwModel(27000, 38.6, 27500, 64.2));
        limitZfwData.add(new LimitZfwModel(31700, 43.2, 31700, 64.5));

    }

    private void initLimitTow() {
        limitTowData = new ArrayList<LimitTowModel>();
        limitTowData.add(new LimitTowModel(22500, 42.8, 22500, 53.1));
        limitTowData.add(new LimitTowModel(31700, 28.3, 27500, 64.2));
        limitTowData.add(new LimitTowModel(34000, 24.8, 31700, 64.5));
        limitTowData.add(new LimitTowModel(38790, 30.1, 34000, 64.6));
        limitTowData.add(new LimitTowModel(38790, 30.1, 38790, 59.0));

    }

    private void initLimitLaw() {
        limitLawData = new ArrayList<LimitLawModel>();
        limitLawData.add(new LimitLawModel(22500, 42.8, 22500, 53.1));
        limitLawData.add(new LimitLawModel(31700, 28.3, 27500, 64.0));
        limitLawData.add(new LimitLawModel(34000, 24.8, 31700, 64.5));
        limitLawData.add(new LimitLawModel(34000, 24.8, 34000, 64.6));

    }

    private void initLimitZfwff() {
        limitZfwffData = new ArrayList<LimitZfwffModel>();
        limitZfwffData.add(new LimitZfwffModel(22500, 39.1, 22500, 71.4));
        limitZfwffData.add(new LimitZfwffModel(27000, 32.3, 27500, 71.8));
        limitZfwffData.add(new LimitZfwffModel(31700, 37.2, 31700, 72.0));

    }

    private void initLimitTowff() {
        limitTowffData = new ArrayList<LimitTowffModel>();
        limitTowffData.add(new LimitTowffModel(22500, 54.7, 22500, 60.65));
        limitTowffData.add(new LimitTowffModel(31700, 32.9, 27500, 71.75));
        limitTowffData.add(new LimitTowffModel(34000, 14.2, 31700, 72.01));
        limitTowffData.add(new LimitTowffModel(38790, 19.2, 34000, 72.16));
        limitTowffData.add(new LimitTowffModel(38790, 19.2, 38790, 66.6));

    }

    private void initPantry() {
        pantryData = new PantryModel(405, -0.02474, 0.00000, 0.00000, 483, 0.02447);

    }

    private void initPax() {
        paxData = new ArrayList<PaxModel>();
        paxData.add(new PaxModel("0A", -0.01313));
        paxData.add(new PaxModel("0B", 0.00022));
        paxData.add(new PaxModel("0C", 0.01257));

    }

    private void initMaxWeights() {
        maxWeightsData = new MaxWeightsModel(38950, 38790, 31700, 34000);
    }

    private void initStabTrimFlap1() {
        ArrayList<StabTrimSubModel> stabTrimSub = new ArrayList<StabTrimSubModel>();
        ArrayList<StabTrimSubSubModel> stabMacs1 = new ArrayList<StabTrimSubSubModel>();
        stabMacs1.add(new StabTrimSubSubModel(7, -6.0));
        stabMacs1.add(new StabTrimSubSubModel(9, -6.0));
        stabMacs1.add(new StabTrimSubSubModel(11, -5.5));
        stabMacs1.add(new StabTrimSubSubModel(13, -5.0));
        stabMacs1.add(new StabTrimSubSubModel(15, -5.0));
        stabMacs1.add(new StabTrimSubSubModel(17, -4.5));
        stabMacs1.add(new StabTrimSubSubModel(19, -4.0));
        stabMacs1.add(new StabTrimSubSubModel(21, -3.5));
        stabMacs1.add(new StabTrimSubSubModel(23, -3.0));
        stabMacs1.add(new StabTrimSubSubModel(25, -3.0));
        stabMacs1.add(new StabTrimSubSubModel(27, -2.5));
        ArrayList<StabTrimSubSubModel> stabMacs2 = new ArrayList<StabTrimSubSubModel>();
        stabMacs2.add(new StabTrimSubSubModel(7, -6.0));
        stabMacs2.add(new StabTrimSubSubModel(9, -6.0));
        stabMacs2.add(new StabTrimSubSubModel(11, -5.5));
        stabMacs2.add(new StabTrimSubSubModel(13, -5.0));
        stabMacs2.add(new StabTrimSubSubModel(15, -5.0));
        stabMacs2.add(new StabTrimSubSubModel(17, -4.5));
        stabMacs2.add(new StabTrimSubSubModel(19, -4.0));
        stabMacs2.add(new StabTrimSubSubModel(21, -3.5));
        stabMacs2.add(new StabTrimSubSubModel(23, -3.0));
        stabMacs2.add(new StabTrimSubSubModel(25, -3.0));
        stabMacs2.add(new StabTrimSubSubModel(27, -2.5));
        stabTrimSub.add(new StabTrimSubModel("FLAP 1", 22500, stabMacs1));
        stabTrimSub.add(new StabTrimSubModel("", 38790, stabMacs2));
        stabTrimFlap1Data = new StabTrimModel(stabTrimSub);
    }

    private void initStabTrimFlap2() {
        ArrayList<StabTrimSubModel> stabTrimSub = new ArrayList<StabTrimSubModel>();
        ArrayList<StabTrimSubSubModel> stabMacs1 = new ArrayList<StabTrimSubSubModel>();
        stabMacs1.add(new StabTrimSubSubModel(7, -6.0));
        stabMacs1.add(new StabTrimSubSubModel(9, -6.0));
        stabMacs1.add(new StabTrimSubSubModel(11, -5.5));
        stabMacs1.add(new StabTrimSubSubModel(13, -5.0));
        stabMacs1.add(new StabTrimSubSubModel(15, -4.5));
        stabMacs1.add(new StabTrimSubSubModel(17, -4.0));
        stabMacs1.add(new StabTrimSubSubModel(19, -3.5));
        stabMacs1.add(new StabTrimSubSubModel(21, -3.5));
        stabMacs1.add(new StabTrimSubSubModel(23, -3.0));
        stabMacs1.add(new StabTrimSubSubModel(25, -2.5));
        stabMacs1.add(new StabTrimSubSubModel(27, -2.0));
        ArrayList<StabTrimSubSubModel> stabMacs2 = new ArrayList<StabTrimSubSubModel>();
        stabMacs2.add(new StabTrimSubSubModel(7, -6.0));
        stabMacs2.add(new StabTrimSubSubModel(9, -6.0));
        stabMacs2.add(new StabTrimSubSubModel(11, -5.5));
        stabMacs2.add(new StabTrimSubSubModel(13, -5.0));
        stabMacs2.add(new StabTrimSubSubModel(15, -4.5));
        stabMacs2.add(new StabTrimSubSubModel(17, -4.0));
        stabMacs2.add(new StabTrimSubSubModel(19, -3.5));
        stabMacs2.add(new StabTrimSubSubModel(21, -3.5));
        stabMacs2.add(new StabTrimSubSubModel(23, -3.0));
        stabMacs2.add(new StabTrimSubSubModel(25, -2.5));
        stabMacs2.add(new StabTrimSubSubModel(27, -2.0));
        stabTrimSub.add(new StabTrimSubModel("FLAP 2", 22500, stabMacs1));
        stabTrimSub.add(new StabTrimSubModel("", 38790, stabMacs2));
        stabTrimFlap2Data = new StabTrimModel(stabTrimSub);
    }

    private void initStabTrimFlap3() {
        ArrayList<StabTrimSubModel> stabTrimSub = new ArrayList<StabTrimSubModel>();
        ArrayList<StabTrimSubSubModel> stabMacs1 = new ArrayList<StabTrimSubSubModel>();
        stabMacs1.add(new StabTrimSubSubModel(7, -6.0));
        stabMacs1.add(new StabTrimSubSubModel(9, -5.5));
        stabMacs1.add(new StabTrimSubSubModel(11, -5.0));
        stabMacs1.add(new StabTrimSubSubModel(13, -4.5));
        stabMacs1.add(new StabTrimSubSubModel(15, -4.0));
        stabMacs1.add(new StabTrimSubSubModel(17, -3.5));
        stabMacs1.add(new StabTrimSubSubModel(19, -3.0));
        stabMacs1.add(new StabTrimSubSubModel(21, -2.5));
        stabMacs1.add(new StabTrimSubSubModel(23, -2.0));
        stabMacs1.add(new StabTrimSubSubModel(25, -1.5));
        stabMacs1.add(new StabTrimSubSubModel(27, -1.0));
        ArrayList<StabTrimSubSubModel> stabMacs2 = new ArrayList<StabTrimSubSubModel>();
        stabMacs2.add(new StabTrimSubSubModel(7, -6.0));
        stabMacs2.add(new StabTrimSubSubModel(9, -5.5));
        stabMacs2.add(new StabTrimSubSubModel(11, -5.0));
        stabMacs2.add(new StabTrimSubSubModel(13, -4.5));
        stabMacs2.add(new StabTrimSubSubModel(15, -4.0));
        stabMacs2.add(new StabTrimSubSubModel(17, -3.5));
        stabMacs2.add(new StabTrimSubSubModel(19, -3.0));
        stabMacs2.add(new StabTrimSubSubModel(21, -2.5));
        stabMacs2.add(new StabTrimSubSubModel(23, -2.0));
        stabMacs2.add(new StabTrimSubSubModel(25, -1.5));
        stabMacs2.add(new StabTrimSubSubModel(27, -1.0));
        stabTrimSub.add(new StabTrimSubModel("FLAP 4", 22500, stabMacs1));
        stabTrimSub.add(new StabTrimSubModel("", 38790, stabMacs2));
        stabTrimFlap3Data = new StabTrimModel(stabTrimSub);
    }

    private void initIdealTrim() {
        idealTrimData = new ArrayList<IdealTrimModel>();
        idealTrimData.add(new IdealTrimModel(22500, 55));
        idealTrimData.add(new IdealTrimModel(31700, 63));

    }

    public String getLabel() {
        return "ERJ 170-200";
    }
    private ArrayList<String> acRegData;
    private ConstModel constData;
    private ArrayList<CrewModel> crewData;
    private ArrayList<ConfigurationModel> configuration;
    private ArrayList<FuelModel> fuelData;
    private ArrayList<HoldsModel> holdsData;
    private ArrayList<LimitZfwModel> limitZfwData;
    private ArrayList<LimitTowModel> limitTowData;
    private ArrayList<LimitLawModel> limitLawData;
    private ArrayList<LimitZfwffModel> limitZfwffData;
    private ArrayList<LimitTowffModel> limitTowffData;
    private PantryModel pantryData;
    private ArrayList<PaxModel> paxData;
    private MaxWeightsModel maxWeightsData;
    private StabTrimModel stabTrimFlap1Data;
    private StabTrimModel stabTrimFlap2Data;
    private StabTrimModel stabTrimFlap3Data;
    private StabTrimModel stabTrimFlap4Data;
    private ArrayList<IdealTrimModel> idealTrimData;
}
